<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .one>li:first-child{
            color: royalblue;
        }
        .one>li:last-child{
            color: yellow;
        }
        /* 匹配元素中第n个元素 */
        .one>li:nth-child(4){
            color: seagreen;
        }
        .two>li:nth-of-type(4){color: yellow;}
        .two>li:nth-child(2n+1){
            color: yellow;
        }
    </style>
</head>
<body>
    <ul class="one">
        <li>123</li>
        <li>123</li>
        <li>123</li>
        <li>123</li>
        <li>123</li>   
        <li>123</li>
    </ul>
    <ul class="two">
        <li>123</li>
        <li>123</li>
        <p>321</p>
        <p>321</p>
        <li>123</li>
        <li>123</li>
        <li>123</li>
        <li>123</li>

    </ul>
</body>
</html>